#!/bin/bash
bash -c "cat >>/var/jenkins_home/.m2/settings.xml" <<EOF
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>~/.m2/repository</localRepository>
    <interactiveMode />
    <offline />
    <profiles />
    <pluginGroups />
    <servers>
        <!-- docker auth -->
        <server>
            <id>docker.io</id>
            <username>mecode</username>
            <password>2527786719</password>
        </server>
        <server>
            <id>registry.cn-chengdu.aliyuncs.com</id>
            <username>778671998@qq.com</username>
            <password>a2527786719</password>
        </server>
    </servers>
    <mirrors>
        <mirror>
            <id>alimaven</id>
            <name>阿里云公共仓库</name>
             <url>https://maven.aliyun.com/repository/public</url>
            <mirrorOf>central</mirrorOf>
        </mirror> 
        <!-- 中央仓库在中国的镜像 -->
        <mirror>
            <id>maven.net.cn</id>
            <name>Mirror from Maven in china</name>
            <url>http://maven.net.cn/content/groups/public/</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
        <!-- <mirror>
            <id>nexus-163</id>
            <mirrorOf>*</mirrorOf>
            <name>Nexus 163</name>
            <url>http://mirrors.163.com/maven/repository/maven-public/</url>
        </mirror> -->
    </mirrors>

</settings>
EOF
